#!/usr/bin/python
# -*- coding: UTF-8 -*-

import dbus
import dbus.glib
import gobject

class HardwareMonitor: 

   def __init__(self):
      bus = dbus.SystemBus()
      obj = bus.get_object('org.freedesktop.Hal', '/org/freedesktop/Hal/Manager')
      hal = dbus.Interface(obj, 'org.freedesktop.Hal.Manager')

      hal.GetAllDevices(reply_handler=self.get_all_devices,
                        error_handler=self.catch_error)


   def get_all_devices(self, devices):
      for device in devices:
         print device

   def catch_error(self, error):
      print error

if __name__ == '__main__':
   hm = HardwareMonitor()

   mainloop = gobject.MainLoop()
   mainloop.run()

